/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-03-26
 * Time: 14:22
 */
 class Student implements Comparable {
    public String name;
    public double score;
    public Student() {

    }
    //有参构造
    public Student( String name,double score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "姓名 ：" + this.name + " 成绩 : " + this.score;
    }

    @Override
    public int compareTo(Object o) {
        Student s = (Student)o;
        if (this.score > s.score) {
            return -1;
        } else if (this.score < s.score) {
            return 1;
        } else {
            return 0;
        }
    }
}
